package com.milling.business.service.impl;

import java.util.List;
import com.milling.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.milling.business.mapper.WmsAreaInfoMapper;
import com.milling.business.domain.WmsAreaInfo;
import com.milling.business.service.IWmsAreaInfoService;

/**
 * 货区设置Service业务层处理
 *
 * @author X
 * @date 2025-01-22
 */
@Service
public class WmsAreaInfoServiceImpl implements IWmsAreaInfoService
{
    @Autowired
    private WmsAreaInfoMapper wmsAreaInfoMapper;

    /**
     * 查询货区设置
     *
     * @param areaId 货区设置主键
     * @return 货区设置
     */
    @Override
    public WmsAreaInfo selectWmsAreaInfoByAreaId(Long areaId)
    {
        return wmsAreaInfoMapper.selectWmsAreaInfoByAreaId(areaId);
    }

    /**
     * 查询货区设置列表
     *
     * @param wmsAreaInfo 货区设置
     * @return 货区设置
     */
    @Override
    public List<WmsAreaInfo> selectWmsAreaInfoList(WmsAreaInfo wmsAreaInfo)
    {
        return wmsAreaInfoMapper.selectWmsAreaInfoList(wmsAreaInfo);
    }

    /**
     * 新增货区设置
     *
     * @param wmsAreaInfo 货区设置
     * @return 结果
     */
    @Override
    public int insertWmsAreaInfo(WmsAreaInfo wmsAreaInfo)
    {
        wmsAreaInfo.setCreateTime(DateUtils.getNowDate());
        return wmsAreaInfoMapper.insertWmsAreaInfo(wmsAreaInfo);
    }

    /**
     * 修改货区设置
     *
     * @param wmsAreaInfo 货区设置
     * @return 结果
     */
    @Override
    public int updateWmsAreaInfo(WmsAreaInfo wmsAreaInfo)
    {
        wmsAreaInfo.setUpdateTime(DateUtils.getNowDate());
        return wmsAreaInfoMapper.updateWmsAreaInfo(wmsAreaInfo);
    }

    /**
     * 批量删除货区设置
     *
     * @param areaIds 需要删除的货区设置主键
     * @return 结果
     */
    @Override
    public int deleteWmsAreaInfoByAreaIds(Long[] areaIds)
    {
        return wmsAreaInfoMapper.deleteWmsAreaInfoByAreaIds(areaIds);
    }

    /**
     * 删除货区设置信息
     *
     * @param areaId 货区设置主键
     * @return 结果
     */
    @Override
    public int deleteWmsAreaInfoByAreaId(Long areaId)
    {
        return wmsAreaInfoMapper.deleteWmsAreaInfoByAreaId(areaId);
    }
}
